//575.分糖果
//https://leetcode.cn/problems/distribute-candies/
class Solution {
public:
    int distributeCandies(vector<int>& candyType) {
        unordered_map<int,int> hash;
        for(int n:candyType) ++hash[n];
        if(hash.size() >= candyType.size()/2) return candyType.size()/2;
        return hash.size();
    }
};